package com.collect.zambia.zhiBean.zhiReceive;

import android.text.TextUtils;

import com.collect.zambia.zhiGlobal.zhiAppSettings.ZHIProjectConstants;
import com.collect.zambia.zhiUtils.StringUtil;

import java.io.Serializable;
import java.math.BigDecimal;

public class ZHIRPerformanceDayDetailEntity implements Serializable {
    private String leven;
    private String assignDate;
    private String assignNum;
    private String assignAmount;
    private String repayNum;
    private String repayAmount;
    private String repayNumRate;
    private String repayAmountRate;
    private String bonus;

    //v2
    private String taskAmount;
    private String taskNum;

    //小红花
    private String rankDisplay;

    private String totalRankNums;
    private String rank;

    public String getLeven() {
        return StringUtil.safeString(leven);
    }

    public void setLeven(String leven) {
        this.leven = leven;
    }

    public String getAssignDate() {
        return StringUtil.safeString(assignDate);
    }

    public void setAssignDate(String assignDate) {
        this.assignDate = assignDate;
    }

    public String getAssignNum() {
        return StringUtil.safeString(assignNum);
    }

    public void setAssignNum(String assignNum) {
        this.assignNum = assignNum;
    }

    public String getAssignAmount() {
        return StringUtil.safeString(assignAmount);
    }

    public String getAssignAmountFormatWithoutFinceUnit() {
        return StringUtil.numberTothousandFormatter(getAssignAmount());
    }

    public void setAssignAmount(String assignAmount) {
        this.assignAmount = assignAmount;
    }

    public String getRepayNum() {
        return StringUtil.safeString(repayNum);
    }

    public int getRepayNumInt() {
        return StringUtil.numberTothousandFormatterInt(getRepayNum());
    }

    public void setRepayNum(String repayNum) {
        this.repayNum = repayNum;
    }

    public String getRepayAmount() {
        return StringUtil.safeString(repayAmount);
    }

    public String getRepayAmountFormat() {
        return StringUtil.numberTothousandFormatter(getRepayAmount()) + ZHIProjectConstants.RS_FLAG;
    }

    public String getRepayAmountFormatWithoutFinceUnit() {
        return StringUtil.numberTothousandFormatter(getRepayAmount());
    }

    public BigDecimal getRepayAmountBigDecimal() {
        String tempString = getRepayAmount();
        if (TextUtils.isEmpty(tempString)) {
            tempString = "0";
        }
        if (tempString.contains("-")) {
            tempString = "0";
        }
        return new BigDecimal(tempString).stripTrailingZeros();
    }

    public void setRepayAmount(String repayAmount) {
        this.repayAmount = repayAmount;
    }

    public String getRepayNumRate() {
        return StringUtil.safeString(repayNumRate);
    }

    public void setRepayNumRate(String repayNumRate) {
        this.repayNumRate = repayNumRate;
    }

    public String getRepayAmountRate() {
        return StringUtil.safeString(repayAmountRate);
    }

    public void setRepayAmountRate(String repayAmountRate) {
        this.repayAmountRate = repayAmountRate;
    }

    public String getBonus() {
        return StringUtil.safeString(bonus);
    }

    public String getBonusFormat() {
        return StringUtil.numberTothousandFormatter(getBonus()) + ZHIProjectConstants.RS_FLAG;
    }

    public String getBonusAddFormat() {
        return "+" + StringUtil.numberTothousandFormatter(getBonus());
    }

    public void setBonus(String bonus) {
        this.bonus = bonus;
    }

    public boolean isLevelB1() {
        return getLeven().contains("B1") || getLeven().contains("M1");
    }

    public boolean isLevelB2() {
        return getLeven().contains("B2") || getLeven().contains("M2");
    }

    public boolean isLevelB3() {
        return getLeven().contains("B3") || getLeven().contains("M3");
    }

    public String getTaskAmount() {
        return StringUtil.safeString(taskAmount);
    }

    public String getTaskAmountFormat() {
        return StringUtil.numberTothousandFormatter(getTaskAmount());
    }

    public void setTaskAmount(String taskAmount) {
        this.taskAmount = taskAmount;
    }

    public String getTaskNum() {
        return StringUtil.safeString(taskNum);
    }

    public void setTaskNum(String taskNum) {
        this.taskNum = taskNum;
    }

    public String getRankDisplay() {
        return StringUtil.safeString(rankDisplay);
    }

    public boolean isYellowCard(){
        return getRankDisplay().equalsIgnoreCase(ZHIRCollecterPerformanceEntity.TYPE_YELLOW_CARD);
    }

    public boolean isGreenCard(){
        return getRankDisplay().equalsIgnoreCase(ZHIRCollecterPerformanceEntity.TYPE_FLOWER);
    }

    public void setRankDisplay(String rankDisplay) {
        this.rankDisplay = rankDisplay;
    }


    public String getTotalRankNums() {
        return StringUtil.safeString(totalRankNums);
    }

    public void setTotalRankNums(String totalRankNums) {
        this.totalRankNums = totalRankNums;
    }

    public String getRank() {
        return StringUtil.safeString(rank);
    }

    public void setRank(String rank) {
        this.rank = rank;
    }
}
